package com.frinder.official.akka.routing;

import akka.actor.ActorRef;
import akka.routing.Routee;

/**
 * Created by frinder on 2017/9/30.
 */
public class Crc32RoutingRoutee implements Routee {

    private final int key;

    public Crc32RoutingRoutee(int key) {
        this.key = key;
    }

    @Override
    public void send(Object message, ActorRef sender) {
    }

    @Override
    public int hashCode() {
        return key;
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof Crc32RoutingRoutee && ((Crc32RoutingRoutee) obj).key == key;
    }
}
